package com.learn.composite.transparent;

import lombok.extern.slf4j.Slf4j;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: SLeaf </p>
 *
 *
 */
@Slf4j
public class Leaf extends Component {

    public Leaf(String name) {
        super(name);
    }

    @Override
    public void add(Component component) {
        log.info("空实现");
    }

    @Override
    public void remove(Component component) {
        log.info("空实现");
    }

    @Override
    public void display(int depth) {
        //输出树形结构
        for(int i=0; i<depth; i++) {
            System.out.print("- ");
        }
        System.out.println(name);
    }
}
